CC=gcc
CFLAGS=-Wall -Werror -O2
LDFLAGS=-lm
SOURCES=bitfile.c DNode.c HashTable.c LZ78.c main.c
OBJECTS=$(SOURCES:.c=.o)
DEP=bitfile.h HashTable.h LZ78.h DNode.h
EXECUTABLE=LZ78

all: $(SOURCES) $(EXECUTABLE)
	
$(EXECUTABLE): $(OBJECTS) 
	$(CC) $(LDFLAGS) $(OBJECTS) -o $@

.c.o:
	$(CC) -c $(CFLAGS) $< -o $@

bitfile.o: bitfile.h

HashTable.o: HashTable.h

DNode.o: DNode.h

LZ78.o: bitfile.h HashTable.h

install:
	mv $(EXECUTABLE) /usr/bin/

clean:
	rm -rf *o LZ78 /usr/bin/LZ78


